package com.project.starter.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class RedisService {

    @Autowired
    private ValueOperations<String, String> stringStringValueOperations;

    @PostConstruct
    public void init() {
        String key = "test";
        stringStringValueOperations.set(key, "hell world!");

    }

    public String getByKey(String key) {
        return stringStringValueOperations.get(key);

    }


}
